<template>
       <div class="addModel" v-if='isWin'>
            <div class="addModelBox">
                <div class="addModelHead flex flex-align-center">
                    <p class="title">开户信息</p>
                    <img src="@/assets/img/business/business-close.png" alt="" @click="onCloseWinFun">
                </div>
                <div class="addModelCont">
                    <p>{{child.info}}</p>
                    <p class="xiaji">下级账号<span>{{child.user_name}}</span></p>
                    <p>密码(预设)<span>{{child.password}}</span></p>
                    <p>下载地址 <textarea type="text" id='textCont' readonly='readonly' :value="child.download_url"> </textarea></p>
                    <div class="flex btnGroup">
                    <div class="copyBtn flex flex-align-center  flex-pack-center" @click="onCopyFun"><p>复制</p></div>
                    <div class="copyBtn flex flex-align-center  flex-pack-center" @click="addUserPostFun"><p>确认</p></div>
                </div>
                </div>
            </div>
        </div>
</template>
<script>
export default {
    data () {
        return {
        }
    },
    props:{
         isWin:{
            type: Boolean,
            default: false 
        },
        child:{
            type:Object,
        }
    },
    methods: {
        onCloseWinFun(){
           this.$emit('close');
        },
        onCopyFun(){
            let text=document.getElementById("textCont");
            text.select(); // 选择对象
            document.execCommand("Copy");  //执行浏览器拷贝
        },
        addUserPostFun(){
             this.$emit('close');
        }
    }
}
</script>
<style lang="less" scoped>
@import url(../../../assets/css/chatroom/copywin.less);
</style>


